package com.spark;

import cn.edu.hfut.dmic.contentextractor.ContentExtractor;
import cn.edu.hfut.dmic.contentextractor.News;
import cn.edu.hfut.dmic.webcollector.net.HttpRequest;


/**
 * Created by TRS on 2017/6/9.
 */
public class WebCollectorDemo {
    public static void main(String[] args) throws Exception {
        String url = "http://js.zjol.com.cn/ycxw_zxtf/201706/t20170609_4191830.shtml";

        HttpRequest request = new HttpRequest(url);
        String html = request.getResponse().getHtmlByCharsetDetect();
        News news = ContentExtractor.getNewsByHtml(html, url);
        System.out.println(news);
    }
}
